package cn.getech.data.development.constant;

import lombok.Getter;

/**
* @Description 超时状态
* @Author  chengweiping
* @Date   2021/1/20 14:30
*/
@Getter
public enum OutHourStatus {
    //0 未超时  1 已超时
    NON_OUT(0, "未超时"),
    HAS_OUT(1, "超时"),
    ;

    Integer status;
    String desc;

    OutHourStatus(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    /**
     * yarn 状态转换成本系统的状态
     * @param key 运行状态
     */
    public static Integer getStatus(String key) {
        for (OutHourStatus value : OutHourStatus.values()) {
            if (value.getDesc().equals(key)) {
                return value.getStatus();
            }
        }
        return 3;
    }
}
